package parser;

import java.util.Date;

import source.RawData;

import common.Data;
import common.Measurment;

public class ParserImpl implements Parser {

	@Override
	public Data parse(RawData rawData) {
		Measurment result = new Measurment();
		String input = rawData.getData();
		String [] inputAr = (input.split(","));
		result.setTemperature(Double.parseDouble(inputAr[inputAr.length-1]));
		result.setDate(new Date());
		return result;
	}

}
